<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <title></title>
    <meta charset="utf-8" />
    <script src="../../js/hpFrame.js"></script>
    <script src="../../js/hpComponent.js"></script>
    <link rel="stylesheet" type="text/css" href="../../css/index.css">
</head>

<body>
    <div id="app" v-cloak>
        <div class="title">
            <img class="systemlog" src="../../img/teacher_logo.png">
            <span class="systemname">教学管理</span>
            <div class="head_menu">
                <div class="head_menuitem" v-for="menu in topMenuList" v-on:click="refreshMain(menu.menuUrl)">
                    <span>{{menu.menuName}}</span>
                </div>
            </div>
            <div class="headother">
                <span class="userinfo" @click="openUserInfo">你好 ! {{userName}}</span>
                <img style="width:30px;height: 30px;margin-right: 10px;cursor: pointer;"
                    src="../../img/icon_loginout.png" @click="logout">
            </div>
        </div>
        <iframe id="iframe1" name="iframe1" :src="frameUrl" scrolling="auto" frameborder="0" class="indexiframe"
            :style="{height:frameHeight+'px'}"></iframe>
    </div>
</body>
<script>
    var pageData = {
        frameUrl: GetRootPath() + "page/course/courseteacher_list.html",
        userName: localStorage.getItem("local_userName"),
        frameHeight: 0,
        topMenuList: [{
            menuName: "课程管理",
            menuUrl: GetRootPath() + "page/course/courseteacher_list.html"
        }, {
            menuName: "通知公告",
            menuUrl: GetRootPath() + "page/notice/noticeteacher_list.html"
        }, {
            menuName: "论坛管理",
            menuUrl: GetRootPath() + "page/subject/subjectteacher_list.html"
        }, ]
    };

    var app = new Vue({
        el: '#app',
        data: pageData,
        methods: {
            refreshMain: function (url) {
                pageData.frameUrl = url;
            },
            openUserInfo: function () {
                OpenTopDialog('userdetail',
                    'page/user/user_modify.html?userId=' + localStorage.getItem("local_userId"), 800,
                    600, '用户信息');
            },
            logout: function () {
                OpenConfirm('提示', '确认退出系统？', function () {
                    localStorage.removeItem("local_userId");
                    localStorage.removeItem("local_userType");
                    localStorage.removeItem("local_userName");
                    localStorage.removeItem("local_tokendate");
                    window.top.location.href = GetRootPath() + "page/home/login.html";
                })

            }
        },
        mounted() {
            checkUserInfo();
            pageData.frameHeight = document.body.clientHeight - 65;
        },
    });
</script>

</html>